mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-06 23:00:25 +08:00
[域名服务]实现基本的线路配置
This commit is contained in:
30
web/public/js/components/ns/ns-route-selector.js
Normal file
30
web/public/js/components/ns/ns-route-selector.js
Normal file
@@ -0,0 +1,30 @@
|
||||
// 选择单一线路
|
||||
Vue.component("ns-route-selector", {
|
||||
props: ["v-route-id"],
|
||||
mounted: function () {
|
||||
let that = this
|
||||
Tea.action("/ns/routes/options")
|
||||
.post()
|
||||
.success(function (resp) {
|
||||
that.routes = resp.data.routes
|
||||
})
|
||||
},
|
||||
data: function () {
|
||||
let routeId = this.vRouteId
|
||||
if (routeId == null) {
|
||||
routeId = 0
|
||||
}
|
||||
return {
|
||||
routeId: routeId,
|
||||
routes: []
|
||||
}
|
||||
},
|
||||
template: `<div>
|
||||
<div v-if="routes.length > 0">
|
||||
<select class="ui dropdown" name="routeId" v-model="routeId">
|
||||
<option value="0">[线路]</option>
|
||||
<option v-for="route in routes" :value="route.id">{{route.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>`
|
||||
})
|
||||
Reference in New Issue
Block a user