I have a component with a specific set of starting data:
data: function (){ return { modalBodyDisplay: \'getUserInput\', // possible values: \'ge
If you are annoyed by the warnings, this is a different method:
const initialData = () => ({}) export default { data() { return initialData(); }, methods: { resetData(){ const data = initialData() Object.keys(data).forEach(k => this[k] = data[k]) } } }
No need to mess with $data.