提交 1402eaa4 编写于 作者: fxy060608's avatar fxy060608

fix(mp): hyphenate component name (easycom)

上级 c783b25d
......@@ -209,7 +209,7 @@ function handleViewEvents (events) {
function genVModel (el, isScopedSlot) {
if (el.model) {
el.model.value = createGenVar(el.attrsMap[ID], isScopedSlot)('v-model', el.model.value)
if (el.tag === 'v-uni-input' || el.tag === 'v-uni-textarea' && !(el.events && el.events.input)) {
if ((el.tag === 'v-uni-input' || el.tag === 'v-uni-textarea') && !(el.events && el.events.input)) {
el.model.callback = `function($$v){$handleVModelEvent(${el.attrsMap[ID]},$$v)}`
} else {
el.model.callback = `function(){}`
......
const path = require('path')
const {
hyphenate,
isComponent
} = require('./util')
......@@ -44,7 +45,8 @@ function updateMPUsingAutoImportComponents (autoComponents, options) {
name,
source
}) => {
usingAutoImportComponents[name] = '/' + formatSource(source)
// 自定义组件统一格式化为 kebab-case
usingAutoImportComponents[hyphenate(name)] = '/' + formatSource(source)
})
updateUsingAutoImportComponents(resourcePath, usingAutoImportComponents) // 更新json
}
......
......@@ -59,7 +59,7 @@ function addVueId (path, state) {
state.options.$vueId = 1
}
const hashId = state.options.hashId
const vueId = String((hashId ? (hashId + '-') : '') + (state.options.$vueId++))
const vueId = (hashId ? (hashId + '-') : '') + (state.options.$vueId++)
let value
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册