我正在升级到 Ember Octane,并且我知道 mixin 已被弃用。我将继续使用它们,直到我弄清楚如何更换它们。与此同时,我想将我的路线切换为使用新的类语法,而不是Route.extend. 新的路由类语法是否支持路由混合?如果是,怎么办?
这与Ember Octane Upgrade 如何将值从组件传递到控制器有关
余烬前辛烷值:
import Route from '@ember/routing/route';
import AbcAuthenticatedRouteMixin from '../../mixins/abc-authenticated-route-mixin';
export default Route.extend(AbcAuthenticatedRouteMixin, {
model() {
return {
oldPassword: '',
newPassword: '',
confirmPassword: ''
};
},
})
Run Code Online (Sandbox Code Playgroud)
余烬后辛烷值:
import Route from '@ember/routing/route';
import AbcAuthenticatedRouteMixin from '../../mixins/abc-authenticated-route-mixin';
export default class ChangePasswordRoute extends Route(AbcAuthenticatedRouteMixin, {
model() {
return {
oldPassword: '',
newPassword: '',
confirmPassword: ''
};
},
}) // I get an error here that says: '{' expected
Run Code Online (Sandbox Code Playgroud)