小编Tua*_*ham的帖子

如何检查对象是否是Vue组件?

有没有可靠的方法来检查对象是否是Vue.js组件?

javascript vue.js vue-component

9
推荐指数
2
解决办法
3004
查看次数

仅使用HQL加入第一行

是否可以使用hql仅连接第一行(或只是任何其他行但只有一行)?

select 
 config.id, mg.modelGroupName, min(deliveryType.id) 
from 
 NotificationConfig config, NotificationConfigEntry configEntry, SettlementModelGroup mg 
join 
 configEntry.notificationConfigEntryPK.user user 
join 
 configEntry.notificationConfigEntryPK.deliveryType deliveryType 
join 
 config.notificationType notifType 
join 
 notifType.objectType objectType 
where 
 config.id = configEntry.notificationConfigEntryPK.notificationConfig.id 
 and ( mg.modelId = config.objectId or config.objectId is null )
Run Code Online (Sandbox Code Playgroud)

当然,这是我现在拥有的代码

min(deliveryType.id) 
Run Code Online (Sandbox Code Playgroud)

不起作用.未映射mg.modelId和config.objectId之间的关系,deliveryType是一个列表.我不能使用不同的原因我需要能够通过deliveryType订购(这没有任何意义,但我还是需要它)和modelGroupName.

hibernate join hql

6
推荐指数
1
解决办法
678
查看次数

带有选择、v-for 和 v-model 的 Vue 预选值

我正在使用selectwithv-model并且有选项 withv-for和 object 作为值。选项是一些由 id 标识的元素。如何根据自定义相等性(在本例中为相等id字段)预选选项?我正在寻找类似于 angularjs 的东西track by来自ng-options.

https://jsfiddle.net/79wsf1n4/5/

如何使用具有相同 id 的值预选输入?

模板:

<div id="vue-instance">
  <select v-model="selected">
    <option v-for="item in inventory" :value="item" :key="item.id">
      {{ item.name }}
    </option>
  </select>
  <p>
    {{ selected.id }}
  </p>
</div>
Run Code Online (Sandbox Code Playgroud)

js:

var vm = new Vue({
  el: '#vue-instance',
  data: {
    inventory: [
      {name: 'MacBook Air', id: 1},
      {name: 'MacBook Pro', id: 2},
      {name: 'Lenovo W530', id: 3},
      {name: 'Acer Aspire One', id: 4} …
Run Code Online (Sandbox Code Playgroud)

javascript vue.js vuejs2

5
推荐指数
1
解决办法
2万
查看次数

标签 统计

javascript ×2

vue.js ×2

hibernate ×1

hql ×1

join ×1

vue-component ×1

vuejs2 ×1