7

Vue 有办法把一大段 html 代码定义为一个变量吗?

 2 years ago
source link: https://www.v2ex.com/t/802763
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

V2EX  ›  Vue.js

Vue 有办法把一大段 html 代码定义为一个变量吗?

  coolair · 2 天前 · 1660 次点击
<template>
    <package v-if="a">
        <same-node>
            <lots-nodes />
        </same-node>
    </package >
    <same-node v-else>
        <lots-nodes />
    </same-node>
<template>

</lots-nodes /> 这里有很多个 elements,这样就有很大一段重复了,有什么办法解决吗?


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK