I want to use weui's picker in vue.js, and also introduce weui.js. Why is the error weui is not defined reported?
<template>
<p class="wrap">
<a href="javascript:;" class="weui-btn weui-btn_default" id="showPicker"》单列选择器</a>
</p>
</template>
<script>
import weuiJs from '../weui-js/weui.js'
export default {
methods: {
checkPicker: function () {
weui.picker([{
label: '飞机票',
value: 0
}, {
label: '火车票',
value: 1
}, {
label: '的士票',
value: 2
},{
label: '公交票 (disabled)',
disabled: true,
value: 3
}, {
label: '其他',
value: 4
}], {
onChange: function (result) {
console.log(result);
},
onConfirm: function (result) {
console.log(result);
}
});
}
}
}
</script>
仅有的幸福2017-05-19 10:35:28
You imported weuijs, and you are using weui.
Solution
Change weuijs to weui
Change weui to weuijs