|
- <template>
- <safe-area class="page">
- <scroll-view>
- <list />
- <addList />
- <add />
- <text>22222222222</text>
- </scroll-view>
- </safe-area>
- </template>
- <script>
- import '../../components/list.stml';
- import '../../components/addList.stml';
- import '../../components/add.stml';
- export default {
- name: 'index',
- apiready() { //like created
- },
- data() {
- return {};
- },
- methods: {}
- };
- </script>
- <style>
- .page {
- height: 100%;
- background-color: aquamarine;
- }
- </style>
复制代码
<template>
<view class="page">
<view class="wrap" v-for="p in plist" :key="p.id">
<text>111111</text>
<text class="pno">编号{{p.pno}}</text>
<text class="color">颜色{p.color}</text>
<text class="pname">名称{p.pname}</text>
<text class="weight">重量{p.weight}</text>
</view>
</view>
</template>
<script>
export default {
name: 'list',
installed(){
//发送请求
//http://127.0.0.1:8080/User/
api.ajax({
url:'http://127.0.0.1:8080/User/',
methods:'get'
}, (plist, err) =>{
if(plist){
this.data.plist=plist.data
console.log(plist)
}else{
console.log(err)
}
})
},
apiready(){//like created
},
data() {
return{
plist: []
}
},
methods: {
}
}
</script>
<style>
.page {
height: 100%;
}
</style> |
|