提交 8dd2e525 编写于 作者: Q qiang

feat(App): view use functional

上级 dd5a0527
......@@ -6,13 +6,6 @@ const tags = require('@dcloudio/uni-cli-shared/lib/tags')
// 仅限 view 层
module.exports = function parseTag (el) {
const tag = el.tag
// web components
// TODO use list
if (tag === 'view' || tag === 'uni-view') {
el.tag = 'uni-view'
return
}
if (el.tag.indexOf('v-uni-') !== 0 && hasOwn(tags, el.tag)) {
el.tag = 'v-uni-' + el.tag
}
......
......@@ -29,13 +29,11 @@ requireComponents.forEach((components, index) => {
const componentConfig = componentModule.default || componentModule
if (__PLATFORM__ === 'app-plus' && componentConfig.name in elements) {
return
}
componentConfig.mixins = componentConfig.mixins ? [].concat(baseMixin, componentConfig.mixins) : [baseMixin]
componentConfig.mixins.push(animation)
if (!componentConfig.functional) {
componentConfig.mixins.push(animation)
}
componentConfig.name = 'VUni' + componentConfig.name
......
<script>
export default {
name: 'View',
functional: true,
render (createElement, context) {
return createElement('uni-view', context.data, context.children)
}
}
</script>
<style>
uni-view {
display: block;
}
uni-view[hidden] {
display: none;
}
</style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册