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+
15## [ 1.0.2] ( https://github.com/ws-rush/power-vue/compare/v0.4.1...v1.0.2 ) (2023-02-23)
26
37
Original file line number Diff line number Diff line change 11< script type ="module ">
2- import { createApp } from '../src'
2+ import { define } from '../src'
33
44
55// 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 ++
1412 }
1513 }
16-
17- connectedCallback ( ) {
18- this . setAttribute ( 'v-scope' , "$el.data()" )
19- createApp ( ) . mount ( this )
20- }
21- }
22-
23- customElements . define ( "my-counter" , MyCounter )
14+ } )
2415</ script >
2516
2617< my-counter count ="hello "> </ my-counter >
Original file line number Diff line number Diff line change 11{
22 "name" : " power-vue" ,
3- "version" : " 1.0.3 " ,
3+ "version" : " 1.0.4 " ,
44 "description" : " petite-vue fork with plugins support" ,
55 "main" : " dist/power-vue.umd.js" ,
66 "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'
12export { createApp } from './app'
23export { nextTick } from './scheduler'
34export { reactive } from '@vue/reactivity'
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export default defineConfig({
1010 minify : 'terser' ,
1111 lib : {
1212 entry : resolve ( __dirname , 'src/index.ts' ) ,
13- name : 'PetiteVue ' ,
13+ name : 'PowerVue ' ,
1414 formats : [ 'es' , 'umd' , 'iife' ]
1515 } ,
1616 rollupOptions : {
You can’t perform that action at this time.
0 commit comments