File tree Expand file tree Collapse file tree 6 files changed +27
-19
lines changed Expand file tree Collapse file tree 6 files changed +27
-19
lines changed Original file line number Diff line number Diff line change
1
+ ## [ 1.0.3] ( https://github.com/ws-rush/power-vue/compare/v0.4.1...v1.0.3 ) (2023-02-23)
2
+
3
+
4
+
1
5
## [ 1.0.2] ( https://github.com/ws-rush/power-vue/compare/v0.4.1...v1.0.2 ) (2023-02-23)
2
6
3
7
Original file line number Diff line number Diff line change 1
1
< script type ="module ">
2
- import { createApp } from '../src'
2
+ import { define } from '../src'
3
3
4
4
5
5
// Custom Elements
6
- export class MyCounter extends HTMLElement {
7
- data ( ) {
8
- return {
9
- $template : `<template>My count is {{ count }}<button @click="inc">++</button></template>` ,
10
- count : 0 ,
11
- inc ( ) {
12
- this . count ++
13
- }
6
+ define ( 'my-counter' , ( ) => {
7
+ return {
8
+ $template : `<template>My count is {{ count }}<button @click="inc">++</button></template>` ,
9
+ count : 0 ,
10
+ inc ( ) {
11
+ this . count ++
14
12
}
15
13
}
16
-
17
- connectedCallback ( ) {
18
- this . setAttribute ( 'v-scope' , "$el.data()" )
19
- createApp ( ) . mount ( this )
20
- }
21
- }
22
-
23
- customElements . define ( "my-counter" , MyCounter )
14
+ } )
24
15
</ script >
25
16
26
17
< my-counter count ="hello "> </ my-counter >
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " power-vue" ,
3
- "version" : " 1.0.3 " ,
3
+ "version" : " 1.0.4 " ,
4
4
"description" : " petite-vue fork with plugins support" ,
5
5
"main" : " dist/power-vue.umd.js" ,
6
6
"unpkg" : " dist/power-vue.iife.js" ,
Original file line number Diff line number Diff line change
1
+ import { createApp } from "./app"
2
+
3
+ export function define ( name : string , data : Function ) {
4
+ customElements . define ( name , class extends HTMLElement {
5
+ data = data
6
+
7
+ connectedCallback ( ) {
8
+ this . setAttribute ( 'v-scope' , "$el.data()" )
9
+ createApp ( ) . mount ( this )
10
+ }
11
+ } )
12
+ }
Original file line number Diff line number Diff line change
1
+ export { define } from './define'
1
2
export { createApp } from './app'
2
3
export { nextTick } from './scheduler'
3
4
export { reactive } from '@vue/reactivity'
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export default defineConfig({
10
10
minify : 'terser' ,
11
11
lib : {
12
12
entry : resolve ( __dirname , 'src/index.ts' ) ,
13
- name : 'PetiteVue ' ,
13
+ name : 'PowerVue ' ,
14
14
formats : [ 'es' , 'umd' , 'iife' ]
15
15
} ,
16
16
rollupOptions : {
You can’t perform that action at this time.
0 commit comments