Home > Web Front-end > JS Tutorial > body text

Sharing tutorial examples of using bmob js-sdk in vue

小云云
Release: 2018-01-24 10:49:56
Original
1510 people have browsed it

Put bmob js-sdk in the static directory, and then introduce it in the form of a script tag in the index.html page, and you can use bmob js-sdk globally in vue. This article mainly shares with you the tutorial on using bmob js-sdk in vue. Friends who need it can refer to it. I hope it can help everyone.

Introduction of BmobSDK

Place bmob js-sdk in the static directory, and then add the script tag to the index.html page Introduced in the form, you can use bmob js-sdk globally in vue




 
  
  
  
 

Copy after login

Create a js folder in the assets directory, and then create key.js to store bmob Use key


Bmob.initialize("你的Application ID", "你的REST API Key");
Copy after login

to introduce key.js into main.js. The introduction of bmobsdk is complete. Now you can request a piece of data to celebrate. [If you need to use bmob for a single js file in a Vue project, you need to introduce key.js, or fill in the bmob application key]


##

import Vue from 'vue'
import App from './App'
import router from './router'
import './assets/js/key' //引入bmob js-sdk
Vue.config.productionTip = false
new Vue({
 el: '#app',
 router,
 render: h => h(App)
})
Copy after login
Related recommendations:


Implement Node.js in WeChat JS-SDK backend interface

Detailed explanation of WeChat JS-SDK development scan interface function implementation code

WeChat JS-SDK image interface development

The above is the detailed content of Sharing tutorial examples of using bmob js-sdk in vue. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!