v-text 底层原理是应用的innerText 简写:{{}} 例: <h2 v-text="1+1"></h2> <span>{{item.newtype}}</span>

先看效果
在这里插入图片描述

在这里插入图片描述

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        [v-cloak]{
            display: none;
        }
    </style>
    <script src="vue.js"></script>
</head>
<body>
    <div id="app">
        <h2 v-text="msg"></h2>
        <h2 v-text="1+1"></h2>
        <h2 v-text="msg.length"></h2>
        <h2 v-text="msg.slice(1)"></h2>
        <h2 v-text="p"></h2>
        <hr>
        <!-- <h2  v-cloak>{{msg}}</h2>
        <h2  v-cloak>{{1+1}}</h2>
        <h2  v-cloak>{{msg.length}}</h2>
        <h2  v-cloak>{{msg.slice(1)}}</h2>
        <h2  v-cloak>{{p}}</h2> -->

    </div>
</body>
</html>

<script>
    var vm = new Vue({
        el:"#app",
        data:{
            msg:"1910",
            p:"<p>不要睡觉</p>"
        }
    })

    /*
        v-text:值为data中的数据
            1、解析data中的数据 
            2、可以解析JS的表达式 

        v-text的底层原理是应用的innerText


        v-text简写:{{}}
    
    */


</script>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在下文的xml文件中我想要指定所有Name的XPath路径,XPath应该怎么表示<UserInfo> <Number> <userNumber>2</userNumber> <sationNum>3</sationNum>> <departmentNum>5</departmentNum> <levelNum>4</levelNum> </Number> <Department> <department0>研发</department0> <department1>工艺</department1> <department2>设备</department2> <department3>运维</department3> <department4>生产</department4> </Department> <Station> <station0>管理员</station0> <station1>工程师</station1> <station2>操作员</station2> </Station> <User> <Name>刘小龙</Name> <Account>123456789</Account> <Department>生产</Department> <Station>操作员</Station> <Level>1</Level> <State>true</State> <UpdateTime>2023-06-12 16:53:21</UpdateTime> <CreateTime>2023-05-04 09:37:49</CreateTime> <Password>123</Password> </User> <User> <Name>蔺晨文</Name> <Account>987654321</Account> <Department>研发</Department> <Station>工程师</Station> <Level>4</Level> <State>true</State> <UpdateTime>2023-06-12 16:53:21</UpdateTime> <CreateTime>2023-05-04 09:37:49</CreateTime> <Password>123</Password> </User> <User> <Name>赵</Name> <Account>2363467894</Account> <Department>工艺</Department> <Station>管理员</Station> <Level>3</Level> <State>true</State> <UpdateTime>2023-06-12 16:53:21</UpdateTime> <CreateTime>2023-05-04 09:37:49</CreateTime> <Password>123</Password> </User> <User> <Name>王</Name> <Account>2363124194</Account> <Department>设备</Department> <Station>工程师</Station> <Level>2</Level> <State>true</State> <UpdateTime>2023-06-12 16:53:21</UpdateTime> <CreateTime>2023-05-04 09:37:49</CreateTime> <Password>123</Password> </User> </UserInfo>
最新发布
07-22
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值