Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #6054 #6087

Merged
merged 2 commits into from
Apr 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"type": "git",
"url": "git+https://github.com/NervJS/taro.git"
},
"//lint-staged": {
"lint-staged": {
"*.{js,jsx}": [
"eslint --fix",
"git add"
Expand All @@ -34,7 +34,7 @@
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"//pre-commit": "lint-staged"
"pre-commit": "lint-staged"
}
},
"keywords": [
Expand Down
10 changes: 9 additions & 1 deletion packages/taro-runtime/src/dsl/common.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable dot-notation */
import { isFunction, EMPTY_OBJ, ensure, Shortcuts, isUndefined, isArray } from '@tarojs/shared'
import { isFunction, EMPTY_OBJ, ensure, Shortcuts, isUndefined, isArray, warn } from '@tarojs/shared'
import { eventHandler } from '../dom/event'
import { Current } from '../current'
import { document } from '../bom/document'
Expand Down Expand Up @@ -253,6 +253,14 @@ export function createRecursiveComponentConfig () {
}
}
},
observers: {
i (val: Record<string, unknown>) {
warn(
val[Shortcuts.NodeName] === '#text',
`请在此元素外再套一层非 Text 元素:<text>${val[Shortcuts.Text]}</text>,详情:https://github.com/NervJS/taro/issues/6054`
)
}
},
options: {
addGlobalClass: true
},
Expand Down