首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >更新vue后的空白屏幕-从版本1.7.0到2.0.0进行实例化搜索

更新vue后的空白屏幕-从版本1.7.0到2.0.0进行实例化搜索
EN

Stack Overflow用户
提问于 2019-03-11 10:45:42
回答 1查看 630关注 0票数 0

节点版本: v10.14.1 NPM版本: 6.4.1: OS: Windows

描述:,我已经在我的vuejs项目中集成了藻类,这个项目运行得很好。现在,我将这个模块从1.7.0升级到2.0.0。在升级软件包时,它显示控制台错误,屏幕上没有显示任何内容。我也试图通过包含所需的包来解决这个问题,但是没有得到结果。以下是控制台错误:

代码语言:javascript
复制
[Vue warn]:Unknown custom element: <ais-index> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
[Vue warn]: Unknown custom element: <ais-input> - did you register the component correctly? For recursive components, make sure to provide the "name" option
[Vue warn]: Error in nextTick: "TypeError: It looks like you forgot to wrap your Algolia search component "<ais-refinement-list>" inside of an "<ais-instant-search>" component."
TypeError: It looks like you forgot to wrap your Algolia search component "<ais-refinement-list>" inside of an "<ais-instant-search>" component.

这是我的代码:

代码语言:javascript
复制
<template>
  <div id="app">
    <p>{msg}</p>
    <div id="app">
      <ais-index app-id="latency" api-key="6be0576ff61c053d5f9a3225e2a90f76" index-name="ikea">
        <ais-search-box placeholder="Search for a product..."></ais-search-box>
        <ais-results>
          <template scope="{ result }">
            <div class="search-result">
              <img class="result__image img-responsive" :src="result.image">

              <div class="result__info">
                <h2 class="result__name">
                  <ais-highlight :result="result" attribute-name="name"/>
                </h2>
                <div class="result__type">
                  <ais-highlight :result="result" attribute-name="type"/>
                </div>
                <div class="result__rating">
                  <template v-for="n in 5">
                    <span v-if="n <= result.rating" class="result__star"></span>
                    <span v-else class="result__star--empty"></span>
                  </template>
                </div>
                <div class="result__price">${{result.price}}</div>
              </div>
            </div>
          </template>
        </ais-results>
        <ais-pagination v-bind:class-names="{'ais-pagination': 'pagination'}"></ais-pagination>
      </ais-index>
    </div>
  </div>
</template>
<script>
代码语言:javascript
复制
//main.js 
import 'babel-polyfill'
import Vue from 'vue'
import Vuetify from 'vuetify'
import InstantSearch from 'vue-instantsearch'

//router 
import router from './router'
Vue.use(InstantSearch)

Vue.config.productionTip = false

new Vue({
    store,
    router,
    i18n,
    render: h => h(App)
}).$mount('#app')

要使它发挥作用,需要进行哪些更改?如果有人需要更多信息,请告诉我。谢谢!

EN

回答 1

Stack Overflow用户

发布于 2019-03-22 11:06:57

根据您的错误消息:

代码语言:javascript
复制
TypeError: It looks like you forgot to wrap your Algolia search component "<ais-refinement-list>" inside of an "<ais-instant-search>" component.

看起来,新的主要版本的<ais-instant-search> API可能需要vue-instantsearch

所以,用<ais-instant-search>包装组件,看看它是如何进行的:)

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55100063

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档