Skip to content
This repository has been archived by the owner on Jun 6, 2020. It is now read-only.

Not working in nuxt #30

Open
tetreault opened this issue Jul 18, 2018 · 1 comment
Open

Not working in nuxt #30

tetreault opened this issue Jul 18, 2018 · 1 comment

Comments

@tetreault
Copy link

I have an empty Nuxt project, I installed VueDPlayer with NPM. I import it as instructed, when I go to use it on an empty page I get the following error: render function or template not defined in component: anonymous

"nuxt": "^1.0.0",
"vue-dplayer": "0.0.10"

@iamwelk
Copy link

iamwelk commented Apr 26, 2019

@tetreault my config works well

// plugins/vue-dplayer.js
import Vue from 'vue'
import VueDPlayer from 'vue-dplayer'
import 'vue-dplayer/dist/vue-dplayer.css'

Vue.use(VueDPlayer)

// nuxt.config.js
plugins: [
  {
    {src: '@/plugins/vue-dplayer', ssr; false}
  }
]

// demo.vue
<template>
  <div>
    <div class="title">欢迎使用</div>
    <no-ssr>
      <div class="video-wrapper">
        <d-player :options="options"></d-player>
      </div>
    </no-ssr>
  </div>
</template>
export default {
  data () {
    return {
      userName: '',
      password: '',
      options: {
        video: {
          url: 'http://static.smartisanos.cn/common/video/t1-ui.mp4',
          pic: 'http://static.smartisanos.cn/pr/img/video/video_03_cc87ce5bdb.jpg'
        }
      }
    }
  }
}

image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants