【发布时间】:2023-03-21 20:24:02
【问题描述】:
我的项目中有自定义函数用作插件
import Vue from 'vue'
function copyText(text) {
var input = document.createElement('input');
input.setAttribute('value', text);
document.body.appendChild(input);
input.select();
var result = document.execCommand('copy');
document.body.removeChild(input);
return result;
}
Vue.prototype.$copyText = (text) => copyText(text);
如何在asyncData 中访问这个 vue prop?
【问题讨论】:
标签: javascript vue.js vuejs2 nuxt.js