Vue.js用整数数组填充选择元素

Don*_*the 2 vue.js

我正在尝试使用Vuejs填充数字1到100的html select字段。我试过了:

<div id="selector">
    <select id='row_selector' class="form-control" v-model="intArray"></select>
</div>

<script type="text/javascript" src="path_to/vue.js"></script>
<script>
const MAX_VAL = 100; 
var numArray = Array.apply(null, {length: numArray}).map(Number.call, Number)
var app = new Vue({
    el: '#selector',
    data: {
        "intArray": numArray
    }
})
Run Code Online (Sandbox Code Playgroud)

但是select元素为空。我是否需要使用指令来填充它?

Sri*_*mam 6

视图

<div id="app">
  <select v-model="selected">
    <option v-for="n in 100" :value="n">{{ n }}</option>
  </select>
  <p>
   Selected: {{ selected }}
  </p>
</div>
Run Code Online (Sandbox Code Playgroud)

零件

new Vue({
  el: '#app',
  data: {
    selected: ''
  }
})
Run Code Online (Sandbox Code Playgroud)