博主之前已经为大家讲了Element入门教程,如果还有什么疑问的话可以查看博主置顶的文章。相信大家对Element框架已经有了一个基本的了解,这次为大家讲一下如何调用股票交易接口源码,接口。
以我自己为例子,我想要调用我股票交易接口源码,接口里的片,并让他在浏览器里显示出来。
注意:'imgurl’为我自己写的股票交易接口源码,接口一个片地址,‘listone’、'listtwo’为我自己写的的股票交易接口源码,接口请里的片。
修改一下maijs文件代码如下:
import Vue from 'vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import App from './App.vue'
import vueRouter from 'vue-router'
import routes from './router/routes.js'
import axios from 'axios'
//修改vue的原始属性
Vue.prototype.$axios = axios
定义路由组件
Vue.use(vueRouter)
const router = new vueRouter({
routes,
mode:'history'
})
Vue.use(ElementUI)
定义路由
new Vue({
router,
el: '#app',
render: h => h(App)
})
//导入你建的Login
import Login from'../views/Login/Index.vue'
//路由配置
let routes = [
{path:'/login',
component:Login,
name:'登录页',
hidden:true}
]
export default routes;
最后修改一下webpacconfijs文件
devServer: {
host: '127.0.0.1',
port: 8010,
proxy: {
'/api/': {
target: 'http://www. 省略.com:8090/'
changeOrigin: true,
pathRewrite: {
'^/api': ''
}
}
},
target:‘http://’为你们自己写的股票交易接口源码,接口地址
文章为作者独立观点,不代表观点