vue一个组件调另一个组件
Say you have a Pixel component in src/components/Pixel.vue
假设您在src/components/Pixel.vue
有一个Pixel组件
In another component, Canvas, which is located in src/components/Canvas.vue
, you can import that Pixel component by importing it inside the script
tag of the Vue Single File Component:
在src/components/Canvas.vue
另一个组件Canvas中,可以通过将其导入到Vue单个文件组件的script
标签中来导入该Pixel组件:
<template>
<p>Canvas</p>
<Pixel />
</template>
<script>
import Pixel from './Pixel'
export default {
name: 'App',
components: {
Pixel
}
}
</script>
vue一个组件调另一个组件