@todovue/tv-search 1.0.4 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -27
- package/dist/entry.d.ts +9 -4
- package/dist/tv-search.cjs.js +2 -499
- package/dist/tv-search.css +1 -1
- package/dist/tv-search.es.js +96 -744
- package/nuxt.js +21 -0
- package/package.json +8 -6
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<p align="center"><img width="150" src="https://
|
|
1
|
+
<p align="center"><img width="150" src="https://res.cloudinary.com/dcdfhi8qz/image/upload/v1763663056/uqqtkgp1lg3xdplutpga.png" alt="TODOvue logo">
|
|
2
2
|
</p>
|
|
3
3
|
|
|
4
4
|
# TODOvue Search (TvSearch)
|
|
@@ -72,28 +72,21 @@ Global registration (main.js / main.ts):
|
|
|
72
72
|
import { createApp } from 'vue'
|
|
73
73
|
import App from './App.vue'
|
|
74
74
|
import { TvSearch } from '@todovue/tv-search'
|
|
75
|
+
import '@todovue/tv-search/style.css' // import styles
|
|
76
|
+
import '@todovue/tv-button/style.css' // import styles
|
|
75
77
|
|
|
76
78
|
createApp(App)
|
|
77
79
|
.use(TvSearch) // enables <TvSearch /> globally
|
|
78
80
|
.mount('#app')
|
|
79
81
|
```
|
|
80
82
|
|
|
81
|
-
Alternatively, register as a component:
|
|
82
|
-
```js
|
|
83
|
-
import { createApp } from 'vue'
|
|
84
|
-
import App from './App.vue'
|
|
85
|
-
import { TvSearch } from '@todovue/tv-search'
|
|
86
|
-
|
|
87
|
-
const app = createApp(App)
|
|
88
|
-
app.component('TvSearch', TvSearch)
|
|
89
|
-
app.mount('#app')
|
|
90
|
-
```
|
|
91
|
-
|
|
92
83
|
Local import inside a component:
|
|
93
84
|
```vue
|
|
94
85
|
<script setup>
|
|
95
86
|
import { ref } from 'vue'
|
|
96
87
|
import { TvSearch } from '@todovue/tv-search'
|
|
88
|
+
import '@todovue/tv-search/style.css' // import styles
|
|
89
|
+
import '@todovue/tv-button/style.css' // import styles
|
|
97
90
|
|
|
98
91
|
const results = ref([
|
|
99
92
|
{
|
|
@@ -136,21 +129,11 @@ function handleSearch(query) {
|
|
|
136
129
|
## Nuxt 3 / SSR Usage
|
|
137
130
|
Create a plugin file: `plugins/tv-search.client.ts` (client-only is recommended since it uses keyboard events):
|
|
138
131
|
```ts
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
})
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
Or use the plugin install method:
|
|
148
|
-
```ts
|
|
149
|
-
import { defineNuxtPlugin } from '#app'
|
|
150
|
-
import { TvSearch } from '@todovue/tv-search'
|
|
151
|
-
|
|
152
|
-
export default defineNuxtPlugin(nuxtApp => {
|
|
153
|
-
nuxtApp.vueApp.use(TvSearch)
|
|
132
|
+
// nuxt.config.ts
|
|
133
|
+
export default defineNuxtConfig({
|
|
134
|
+
modules: [
|
|
135
|
+
'@todovue/tv-search/nuxt'
|
|
136
|
+
]
|
|
154
137
|
})
|
|
155
138
|
```
|
|
156
139
|
|
package/dist/entry.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
1
|
+
import { Plugin } from 'vue';
|
|
2
|
+
import { default as _TvSearch } from './components/TvSearch.vue';
|
|
3
|
+
declare const TvSearch: typeof _TvSearch & Plugin;
|
|
5
4
|
export { TvSearch };
|
|
5
|
+
export declare const TvSearchPlugin: Plugin;
|
|
6
6
|
export default TvSearch;
|
|
7
|
+
declare module 'vue' {
|
|
8
|
+
interface GlobalComponents {
|
|
9
|
+
TvSearch: typeof TvSearch;
|
|
10
|
+
}
|
|
11
|
+
}
|