//获取图片地址---用于组件变量赋值
getDictCode(){
   return require("edu_chapter,name,id, level='1' and product_id='+ this.productId +'");
},

dictCode="edu_chapter,name,id, product_id='1' and level='1'"

组件绑定变量
v-model 双向绑定
v-bind:value 

绑定值拼接字符串
<cell :title="`当前门店:${item.Storename}`" link="/component/radio" :inline-desc="'门店地址:' + item.Storeaddess"></cell>
:title="`字符串${xx}`"
:title="'字符串' + xx"

//在方法中进行绑定
<template>
    <li class="list-group-item">
        <div class="handle">
            <a href="javascript:;" @click="del">删除</a>
        </div>
        <p class="name"><span>{{comment.name}}</span><span>说:</span></p>
        <p class="content">{{comment.content}}</p>
    </li>
</template>
<script>
    export default {
        data() {
            return {
                comment: {
                    name: '张三',
                    content: '哈哈哈,Vue.js挺好用的。'
                }
            }
        },
        methods: {
            del() {
                alert(this.comment.name);
                if(window.confirm(`确定要删除${this.comment.name}的评论吗?`)) {
                    //这里省略实现删除的方法
                }
            }
        }
    }
</script>
 

Logo

前往低代码交流专区

更多推荐