You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/hooks/README.md
+65-7Lines changed: 65 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,15 +112,73 @@ function Index() {
112
112
</script>
113
113
```
114
114
115
+
## 🎰 auto-import
116
+
117
+
We provide the @taro-hooks/plugin-auto-import plugin to help you quickly use the [unplugin-auto-import](https://github.com/antfu/unplugin-auto-import) capability.
118
+
119
+
```bash
120
+
# npm
121
+
$ npm i @taro-hooks/plugin-auto-import
122
+
# yarn
123
+
$ yarn add @taro-hooks/plugin-auto-import
124
+
# pnpm
125
+
$ pnpm add @taro-hooks/plugin-auto-import
126
+
```
127
+
128
+
```js
129
+
// config/index.js
130
+
constconfig= {
131
+
// ...
132
+
// The main prerequisite is that you have installed the plugin for the corresponding framework.
133
+
plugins: [
134
+
// If you are using vue3, please install the @taro-hooks/plugin-vue plugin beforehand.
135
+
'@taro-hooks/plugin-vue',
136
+
// If using React/PReact/Nerv, please pre-install the @taro-hooks/plugin-react plugin.
137
+
'@taro-hooks/plugin-react',
138
+
// Finally, the auto-import plugin is configured
139
+
[
140
+
'@taro-hooks/plugin-auto-import',
141
+
{
142
+
// your options, see configuration: https://github.com/antfu/unplugin-auto-import#configuration
0 commit comments