Skip to content

Commit

Permalink
add vue3 init logic
Browse files Browse the repository at this point in the history
  • Loading branch information
cuixiaorui committed Jun 20, 2020
1 parent a38c608 commit dfe9bea
Show file tree
Hide file tree
Showing 22 changed files with 809 additions and 34 deletions.
35 changes: 20 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
# rollup-starter-ts
## mini-vue
实现最简 vue3 模型,用于学习

To fast start a typescript library.

## Getting started

Clone this repository and install its dependencies:

```bash
git clone https://github.com/zenoslin/rollup-starter-ts.git
cd rollup-starter-ts
npm install
### build
```shell
yarn build
```

## scripts
- `npm run build` builds the library to `lib`.
- `npm run build:type` builds `.d.ts` file for the library.
- `npm run test` use `jest` to test the source files.
### example
直接打开 example/index.html 即可



## License
[MIT](LICENSE)
### tasking
- [ ] runtime-core 初始化逻辑
- [ ] 基础类型的处理:static fragment comment
- [ ] 触发各种 hook
- [ ] 标准化 vnode 的实现
- [ ] 初始化 props 逻辑
- [ ] 初始化 slots 逻辑
- [ ] proxy 暴露给用户的代理实现
- [ ] 支持 template
- [ ] 给元素设置 props
- [ ] 需要过滤掉vue自身用的key
11 changes: 11 additions & 0 deletions example/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { h } from "../lib/mini-vue.esm.js";
import HelloWorld from "./components/HelloWorld.js";

export default {
name:"App",
setup() {},

render() {
return h("div", { tId: 1 }, [h("p", {}, "你好,我是p"), h(HelloWorld)]);
},
};
8 changes: 8 additions & 0 deletions example/components/HelloWorld.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { h } from "../../lib/mini-vue.esm.js";
export default {
name: "HelloWorld",
setup() {},
render() {
return h("div", { tId: "helloWorld" }, "hello world vue3");
},
};
1 change: 1 addition & 0 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
</head>
<body>

<div id="root"></div>

<script src="main.js" type="module"></script>
</body>
Expand Down
6 changes: 4 additions & 2 deletions example/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import {add} from '../lib/bundle.esm.js'
import { createApp } from "../lib/mini-vue.esm.js";
import App from "./App.js";

console.log(add)
const rootContainer = document.querySelector("#root");
createApp(App).mount(rootContainer);
195 changes: 195 additions & 0 deletions lib/mini-vue.cjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/mini-vue.cjs.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit dfe9bea

Please sign in to comment.