Bmob js-sdk tutorial in vue, bmobjs-sdk
Introduction of BmobSDK
Put bmob js-sdkin the staticdirectory, and then introduce it as a script tag on the index.html page. You can use bmob js-sdk globally in the vue.
<!DOCTYPE html>
Create a js folder in the assets directory, and then create key. js to store the bmob application key.
Bmob. initialize ("Your Application ID", "your rest api Key ");
When key. js is introduced in main. js, bmobsdk has been introduced. Now you can request a piece of data to celebrate. [If you need to use bmob for a single js file in the Vue project, you need to introduce key. js or enter the bmob application key]
Import Vue from 'vue 'import App from '. /App 'import router from '. /router 'import '. /assets/js/key' // introduce bmob js-sdkVue.config.productionTip = falsenew Vue ({el: '# app', router, render: h => h (app )})
Summary
The above section describes how to use bmob js-sdk in vue. I hope it will help you. If you have any questions, please leave a message, the editor will reply to you in time!