前提・実現したいこと
Vue.jsの単一コンポーネントの中で、
外部で作成したjsファイルの関数を呼び出したいです。
js
1 2function double(num) { 3 return num * 2 4} 5 6
vue
1<script> 2import test from "./test.js" 3 4export default { 5 name: "HelloWorld", 6 components: { 7 test 8 }, 9 methods: { 10 getFeed: getDouble(num) { 11 return test.double(num) 12 } 13 } 14}; 15</script>
のように書いてみましたがうまくいきませんでした。
外部のjsの関数をどうすればよびだせるでしょうか
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/03/30 12:19