我设置了一个非常简单的complete.ly
文本框,但我的选项没有显示。我怀疑我错过了一些显而易见的事情。
这确实是一个非常基本的例子:
var strategyChoice = ["a", "b", "c"];
$(function() {
var pv = completely(document.getElementById('container'));
pv.onChange = function(text) {
console.log(text);
if (text === 'i') {
pv.setText('I want to'); // special case i becomes 'I want to'.
return;
}
if (text === 'I want to ') {
pv.options = ["pay", "receive"];
pv.repaint();
console.log(pv.options);
return;
}
if (["I want to pay ", "I want to receive "].includes(text)) {
pv.options = strategyChoice;
pv.repaint();
console.log(pv.options);
return;
}
}
这个小提琴显示了这个问题。