【发布时间】:2016-11-10 23:32:38
【问题描述】:
如何从标签中获取属性值,如宽度、颜色、值...
<template>
{{#if body.width > 979px }}
{{> tmp1 }}
{{else}}
{{> tmp2 }}
{{/if}}
</template>
<template name="tmp1">...</template>
<template name="tmp2">...</template>
【问题讨论】:
-
你做了哪些研究?你试过什么?
-
我发现的唯一方法是制作动态模板,然后在 onRendered 事件中使用 js 获取这些值,但卡在窗口调整大小事件中。