1.1.2 • Published 5 years ago

@lucky-joel/vue-fetch-model v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

fetch-model

npm npm vue2

目录

安装

npm install --save @lucky-joel/vue-fetch-model

使用

<template>
  <div class="main">
    <!-- 一个model -->
    <lj-fetch-model 
      :url="$SERVER_PREFIX + '/singer/detail/1'"
    >
      <template slot-scope="scope">
        接口1数据:{{scope.data.name}}
      </template>
    </lj-fetch-model>

    <!-- 多个model -->
    <lj-fetch-model 
      :url="[
        $SERVER_PREFIX + '/singer/detail/1',
        $SERVER_PREFIX + '/song/detail/2',
      ]">
      <template slot-scope="scope">
        接口1数据:{{scope.data[0].name}} <br>
        接口2数据:{{scope.data[1].name}}
      </template>
    </lj-fetch-model>
  </div>
</template>

<script>
import Vue from 'vue'
import fetchModel from '@lucky-joel/vue-fetch-model'
Vue.use(fetchModel)

export default {
  ...
}
</script>

参数:

  • url: 接口地址。必填。

构建

npm run build

发布到 npm

npm run build
npm publish --access public

License

MIT

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago