跳至主要內容

v-html 原生HTML指令


v-html 原生HTML指令

v-html Demo
<template>
  <div style="text-align: center;">
    <h1>这里是模板的内容:<span v-html="helloHTML"></span></h1>
  </div>
</template>
<script>
export default {
  data(){
      return{
        helloHTML:"<span style='color:red;'>Hello World</span>",
      }
  },
};
</script>
上次编辑于:
贡献者: Neil