1. mui.js 推荐全局引用
Mui的css,js以及扩展js,推荐在main.js全局引用即可,千万不要再在子组件中重复引用,虽然不会报错
但是某些插件的返回结果会有意向不到的后果,比如numbox,不会累加,而是跳跃(1,3,5,7...)
picker选择返回结果也是重复的多次数据。
import './lib/mui/css/mui.css'
import './lib/mui/css/icons-extra.css'
import './lib/mui/css/mui.picker.css'
import './lib/mui/css/mui.poppicker.css'
import mui from './lib/mui/js/mui.js'
** ← 引用一次就够了**
import './lib/mui/js/mui.picker.js'
import './lib/mui/js/mui.poppicker.js'
mui.js 有些时候会莫名奇妙报错 “Uncaught ReferenceError: mui is not defined”
可把在mui.js的源文件后最后加上 window.mui = mui;
mui是非严格模式js语法代码
在使用webpack的时候也会报错,在webpack配置文件webpack.config.js中 加入代码:
transform-remove-strict-mode
示例:"plugins":["transform-runtime","transform-remove-strict-mode",["component",[{"libraryName":"mint-ui","style":true}]]]