解决方法
(在一个问题编辑中回答,转换为社区wiki答案,见
Question with no answers,but issue solved in the comments (or extended in chat))
OP写道:
After some digging,I solved my question by
$("#e20").select2({ tags:["red","green","blue"],tokenSeparators: [","," "] });
The key point is the
tokenSeparators
attribute.And the 07001 is useful.