feat: Architecture initialization
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
.container {
|
||||
text-align: center;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.title {
|
||||
color: #1677ff;
|
||||
}
|
||||
|
||||
.desc {
|
||||
code {
|
||||
background: #f5f5f5;
|
||||
padding: 2px 6px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import { defineComponent } from 'vue';
|
||||
import styles from './HelloWorld.module.less';
|
||||
|
||||
/**
|
||||
* 公共组件示例
|
||||
*/
|
||||
export default defineComponent({
|
||||
name: 'HelloWorld',
|
||||
props: {
|
||||
msg: {
|
||||
type: String,
|
||||
default: 'Hello World',
|
||||
},
|
||||
},
|
||||
setup(props) {
|
||||
return () => (
|
||||
<div class={styles.container}>
|
||||
<h3 class={styles.title}>{props.msg}</h3>
|
||||
<p class={styles.desc}>
|
||||
这是一个公共组件示例,采用 TSX 写法。你可以在
|
||||
<code>src/components</code>
|
||||
下继续扩展。
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,5 @@
|
||||
/**
|
||||
* 公共组件统一导出
|
||||
* 在业务中可通过 `import { HelloWorld } from '@/components'` 使用
|
||||
*/
|
||||
export { default as HelloWorld } from './HelloWorld';
|
||||
Reference in New Issue
Block a user