Skip to content

Commit b2b6e64

Browse files
committed
cleaning up typed typescript
1 parent 5c98827 commit b2b6e64

File tree

3 files changed

+34
-2
lines changed

3 files changed

+34
-2
lines changed

src/Typed/Resources/assets/src/controller.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,25 @@ export default class extends Controller {
3434
contentType: { type: String, default: 'html' },
3535
};
3636

37+
readonly stringsValue!: string[];
38+
readonly typeSpeedValue: number;
39+
readonly smartBackspaceValue: boolean;
40+
readonly startDelayValue?: number;
41+
readonly backSpeedValue?: number;
42+
readonly shuffleValue?: boolean;
43+
readonly backDelayValue: number;
44+
readonly fadeOutValue?: boolean;
45+
readonly fadeOutClassValue: string;
46+
readonly fadeOutDelayValue: number;
47+
readonly loopValue?: boolean;
48+
readonly loopCountValue: number;
49+
readonly showCursorValue: boolean;
50+
readonly cursorCharValue: string;
51+
readonly autoInsertCssValue: boolean;
52+
readonly attrValue?: string;
53+
readonly bindInputFocusEventsValue?: boolean;
54+
readonly contentTypeValue: string;
55+
3756
connect() {
3857
const options = {
3958
strings: this.stringsValue,

src/Vue/Resources/assets/dist/register_controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function registerVueControllerComponents(context) {
77
window.resolveVueComponent = (name) => {
88
const component = vueControllers[`./${name}.vue`];
99
if (typeof component === 'undefined') {
10-
throw new Error('Vue controller "' + name + '" does not exist');
10+
throw new Error(`Vue controller "${name}" does not exist`);
1111
}
1212
return component;
1313
};

src/Vue/Resources/assets/dist/render_controller.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,21 @@ class default_1 extends Controller {
88
this._dispatchEvent('vue:connect', { componentName: this.componentValue, props: this.props });
99
const component = window.resolveVueComponent(this.componentValue);
1010
this.app = createApp(component, this.props);
11+
if (this.element.__vue_app__ !== undefined) {
12+
this.element.__vue_app__.unmount();
13+
}
14+
this._dispatchEvent('vue:before-mount', {
15+
componentName: this.componentValue,
16+
component: component,
17+
props: this.props,
18+
app: this.app,
19+
});
1120
this.app.mount(this.element);
12-
this._dispatchEvent('vue:mount', { componentName: this.componentValue, component: component, props: this.props });
21+
this._dispatchEvent('vue:mount', {
22+
componentName: this.componentValue,
23+
component: component,
24+
props: this.props,
25+
});
1326
}
1427
disconnect() {
1528
this.app.unmount();

0 commit comments

Comments
 (0)