vue non-props属性

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>lesson 17</title>
    <script src="https://unpkg.com/vue@next"></script>
</head>
<body>
    <div id="root"></div>
</body>
<script>
    // Non-prop 属性
    const app = Vue.createApp({
        template:`
            <div><counter msg="hello" msg1="world" /></div>
        `
    });
    
    app.component('counter',{
        // props:['msg'],
        // inheritAttrs: false,
        template:`
            <div v-bind="$attrs">Counter</div>
            <div v-bind="$attrs.msg">Counter</div>
            <div>Counter</div>
        `
    });
    app.mount('#root');
</script>
</html>
上一篇:Video-based Person Re-identification via 3D Convolutional Networks and Non-local Attention


下一篇:kaggle住房预测项目——第1部分