【备忘录】不使用mixin,公用方法运行于vue-scope下
common.js中个方法:
export const foo = function () {
};
foo运行于demo.vue中
<template>..</template> <script> import { foo } from './common' export default { mounted() { this.foo = foo.bind(this); } } </script>
common.js中个方法:
export const foo = function () {
};
foo运行于demo.vue中
<template>..</template> <script> import { foo } from './common' export default { mounted() { this.foo = foo.bind(this); } } </script>