-
Notifications
You must be signed in to change notification settings - Fork 49
9.3. Vue.js 开发
李李家良 edited this page Jul 12, 2017
·
3 revisions
客户端在新建项目的时候,可以选择 Vue.js 的项目类型,则自动创建 vue 项目。
在 vue 组件 template 内联 svg 是一件头痛的事情,因为如果单纯 使用 变量 去保存 SVG 代码,然后在 v-html 动态生成的做法,无疑会带来 占用 变量内存空间 / 产生多余的 Getter & Setter / v-html 是动态插入 DOM 元素无法 CSS scoped 等等问题。
LegoFlow Vue Template 加入新的资源策略,通过 inline 方式,在编译过程嵌入到 组件 template 里,从而可以完美避免上述问题。
例如
<template>
<div>
<img inline src="./arrow.svg"/>
</div>
</template>