explore petite-vue functionalities ...
This commit is contained in:
		
							parent
							
								
									9bdde0637d
								
							
						
					
					
						commit
						55c6ad1a5f
					
				
					 4 changed files with 11 additions and 6 deletions
				
			
		|  | @ -1,6 +1,6 @@ | ||||||
| import { createApp } from './lib/petite-vue.es.js' | import { createApp } from './lib/petite-vue.es.js' | ||||||
| 
 | 
 | ||||||
| const apiUrl = 'http://localhost:8125/api/system/poll/service/pclt-0001' | const apiUrl = '/api/system/poll/service/pclt-0001' | ||||||
| 
 | 
 | ||||||
| const appdata = { | const appdata = { | ||||||
| 	$delimiters: ['{|', '|}'], | 	$delimiters: ['{|', '|}'], | ||||||
|  | @ -8,7 +8,10 @@ const appdata = { | ||||||
| 	poll, | 	poll, | ||||||
| 	newdata: '', | 	newdata: '', | ||||||
| 	data: '', | 	data: '', | ||||||
| 	save | 	save, | ||||||
|  | 	mounted() { | ||||||
|  | 		console.log('app mounted') | ||||||
|  | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| createApp(appdata).mount() | createApp(appdata).mount() | ||||||
|  |  | ||||||
|  | @ -2,6 +2,7 @@ | ||||||
| title:  "example" | title:  "example" | ||||||
| summary: "" | summary: "" | ||||||
| img: | img: | ||||||
|  | pageid:  | ||||||
| domains: [] | domains: [] | ||||||
| topics: [] | topics: [] | ||||||
| date:   2023-02-16 | date:   2023-02-16 | ||||||
|  | @ -16,6 +17,6 @@ cyberscopes example site - use petite-vue in Hugo-generated sites. | ||||||
| 
 | 
 | ||||||
| {{< pv-count init="7" expr="count--" label="dec" >}} | {{< pv-count init="7" expr="count--" label="dec" >}} | ||||||
| 
 | 
 | ||||||
| {{< pv-count init="99" expr="save('Hello World!')" label="log" >}} | {{< pv-count init="99" expr="save()" label="log" >}} | ||||||
| 
 | 
 | ||||||
| {{< input >}} | {{< input >}} | ||||||
|  |  | ||||||
|  | @ -1,2 +1,3 @@ | ||||||
|  | <div>{{ or .Params.Pageid .File.UniqueID "unknown" }}</div> | ||||||
| {{ $js := resources.Get "js/main.ts" | js.Build (dict "minify" false) }} | {{ $js := resources.Get "js/main.ts" | js.Build (dict "minify" false) }} | ||||||
| <script src="{{ $js.Permalink }}" defer></script> | <script src="{{ $js.Permalink }}" defer></script> | ||||||
|  |  | ||||||
|  | @ -4,12 +4,12 @@ | ||||||
|  		 @change="save" /> |  		 @change="save" /> | ||||||
| </div> | </div> | ||||||
| 
 | 
 | ||||||
| <div v-scope> | <div v-scope @vue:mounted="mounted"> | ||||||
|   <pre v-effect="$el.textContent = data" ></pre> |   <pre v-text="data"></pre> | ||||||
| </div> | </div> | ||||||
| 
 | 
 | ||||||
| <div v-scope> | <div v-scope> | ||||||
|   <pre v-effect="$el.textContent = newdata" ></pre> |   <pre v-text="newdata" @vue:mounted="mounted"></pre> | ||||||
| </div> | </div> | ||||||
| 
 | 
 | ||||||
| <div v-scope> | <div v-scope> | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue