疑問
javascriptの「export」と「export default」の違いは、
exportは複数指定できるが、
export defaultは一つだけ
だと書いてあるサイトがありましたが、
vueの公式サイトでは複数指定していました。
javascriptとvue.jsでは仕様が変わってくるのでしょうか?
該当のソースコード
元url:https://ja.vuejs.org/guide/introduction.html#api-styles
vue.js
1<script> 2export default { 3 // Properties returned from data() become reactive state 4 // and will be exposed on `this`. 5 data() { 6 return { 7 count: 0 8 } 9 }, 10 11 // Methods are functions that mutate state and trigger updates. 12 // They can be bound as event handlers in templates. 13 methods: { 14 increment() { 15 this.count++ 16 } 17 }, 18 19 // Lifecycle hooks are called at different stages 20 // of a component's lifecycle. 21 // This function will be called when the component is mounted. 22 mounted() { 23 console.log(`The initial count is ${this.count}.`) 24 } 25} 26</script> 27 28<template> 29 <button @click="increment">Count is: {{ count }}</button> 30</template>
私の解釈
オブジェクトと判断して、
{ }を一つだと認識している?
回答よろしくお願いいたします。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2023/07/24 06:43
2023/07/24 06:43