Los datos devueltos por la API de llamada axios se asignan a opciones, se informa un error TypeError: No se pueden establecer las 'opciones' de propiedades de indefinido
axios get ( ' / api / ServerInfo / GetQueryTypedTSSST ' ) .then (function (res) { this .options = res.data }). catch (function (error) { console.log (error); });
Pero ya declarado en el componente
data () { return { opciones: [],
En el then
interior no puede ser instanciada usando el Vue this
, porque el interior this
no está vinculado.
Puede usar las funciones de flecha ES6
axios.get ('/ api / ServerInfo / GetQueryTypedTSSST' ) .then ((res) => { this .options = res.data }). catch ( function (error) { console.log (error); });
O definir eso fuera de los axios
var that = this axios.get ( '/ api / ServerInfo / GetQueryTypedTSSST' ) .then ( function (res) { this .options = res.data }). catch ( function (error) { console.log (error); });