Javascript 如何更改vue cookie法则默认道具
我正在尝试使用道具更改组件vue cookie法则的默认值 我可以直接从node_模块插件源代码更改默认值,但我想从Vue单文件组件更改它 vue cookie法则- 道具默认类型Javascript 如何更改vue cookie法则默认道具,javascript,html,vue.js,Javascript,Html,Vue.js,我正在尝试使用道具更改组件vue cookie法则的默认值 我可以直接从node_模块插件源代码更改默认值,但我想从Vue单文件组件更改它 vue cookie法则- 道具默认类型 按钮文字:“明白了!” 因为我以前没有使用过道具,所以我尝试了一些东西,下面是我的CookieLaw.vue组件 <template> <footer> <cookie-law theme="base"> <div slot="message">
按钮文字:“明白了!” 因为我以前没有使用过道具,所以我尝试了一些东西,下面是我的CookieLaw.vue组件
<template>
<footer>
<cookie-law theme="base">
<div slot="message">
We use cookies to enhance your experience. By continuing to visit our site you agree to our use of cookies.
<router-link to="terms_and_conditions">View Policy</router-link>
</div>
</cookie-law>
</footer>
</template>
<script>
import CookieLaw from "vue-cookie-law";
export default {
props: {
buttonText: {
default: "Agree"
}
},
components: { CookieLaw }
};
</script>
我们使用cookies来增强您的体验。通过继续访问我们的网站,您同意我们使用cookie。
查看策略
从“vue cookie law”导入CookieLaw;
导出默认值{
道具:{
按钮文字:{
默认:“同意”
}
},
组件:{CookieLaw}
};
这些道具不会更改默认的
buttonText
buttonText
是vue cookie law
组件的默认道具之一。。。不是父组件(导入它的组件),因此必须将它们绑定到它自己的组件:
...
或绑定动态值:
从“vue cookie law”导入CookieLaw;
导出默认值{
数据(){
返回{
文本:“同意”
}
}
组成部分:{
库克劳
}
}; <
...