mirror of
https://github.com/youzan/vant.git
synced 2025-10-18 17:51:54 +00:00
docs: code split docsearch (#10648)
This commit is contained in:
@@ -3,9 +3,6 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import '@docsearch/css';
|
|
||||||
import docsearch from '@docsearch/js';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'VanDocSearch',
|
name: 'VanDocSearch',
|
||||||
|
|
||||||
@@ -27,9 +24,12 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
initDocsearch() {
|
initDocsearch() {
|
||||||
if (this.searchConfig) {
|
if (this.searchConfig) {
|
||||||
docsearch({
|
import('@docsearch/css');
|
||||||
...this.searchConfig,
|
import('@docsearch/js').then((docsearch) => {
|
||||||
container: '#docsearch',
|
docsearch.default({
|
||||||
|
...this.searchConfig,
|
||||||
|
container: '#docsearch',
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user