Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for Vue Upgrade #108

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/components/kytos/inputs/Input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import KytosBaseWithIcon from '../base/KytosBaseWithIcon';
export default {
name: 'k-input',
mixins: [KytosBaseWithIcon],
compatConfig: {
MODE: 3,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice that you changed the compatibility mode to 3, @HeriLFIU !

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we change it globally ? is there any broken code that would be impacted ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, but I only changed it for two individual components, since the changes worked in vue3 but did not work in vue2, since they were incompatible.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed it globally to MODE3 on webpack/webpack.common.js just for testing and it seems to work fine (despite additional warnings on compilation)

},
props: {
/**
* The value to input button.
Expand Down Expand Up @@ -49,6 +52,7 @@ export default {
default: function(val) {return}
}
},
emits: ['update:value'],
methods: {
updateText(){
this.$emit('update:value', this.$refs.inputValue.value)
Expand Down
7 changes: 5 additions & 2 deletions src/components/kytos/inputs/InputAutocomplete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ import KytosBaseWithIcon from '../base/KytosBaseWithIcon';
* @example /_static/imgs/components/input/k-input-auto.png
*/
var CustomInput = {
compatConfig: {
MODE: 3,
},
props: {
value: {
type: String,
Expand Down Expand Up @@ -130,8 +133,8 @@ var CustomInput = {
type: String,
default: ""
}
},
template: '<input :id="id" class="k-input" :tooltip="tooltip" ref="inputValue" :placeholder="placeholder" :value="value" v-on="$listeners" />'
},
template: '<input :id="id" class="k-input" :tooltip="tooltip" ref="inputValue" :placeholder="placeholder" :value="value" v-bind="$attrs" />'
}

export default {
Expand Down
2 changes: 1 addition & 1 deletion src/components/kytos/logging/Logging.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<k-button title="Debug" @click="select('debug')" tooltip="Only debug messages"></k-button>
</k-button-group>
<k-button-group>
<k-input v-model="highlight_string" v-on:change='highlight' icon="lightbulb" tooltip="Highlight string" placeholder="Highlight string"></k-input>
<k-input v-model:value="highlight_string" v-on:change='highlight' icon="lightbulb" tooltip="Highlight string" placeholder="Highlight string"></k-input>
</k-button-group>
</div>

Expand Down
2 changes: 1 addition & 1 deletion src/components/kytos/misc/StatusMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<k-toolbar-item icon="signal" tooltip="Status Menu">
<div class="k-status-menu">
<div class="k-status-title">
<icon :icon="signal"></icon>
<icon icon="signal"></icon>
<div class="panel-title">
<h1> Status Menu </h1>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const kytos = createApp({
},
})

Vue.use(VueHotkey)
kytos.use(VueHotkey)

window.$ = window.jQuery = require('jquery');
window.d3 = window.D3 = require('d3');
Expand Down Expand Up @@ -125,7 +125,7 @@ kytos.component('k-notification', KytosNotification)
// Preserve extra whitespaces
kytos.config.compilerOptions.whitespace = 'preserve';

kytos.config.globalProperties.$kytos = new Vue()
kytos.config.globalProperties.$kytos = kytos
kytos.config.globalProperties.$kytos_server = window.kytos_server
kytos.config.globalProperties.$kytos_server_api = window.kytos_server_api
kytos.config.globalProperties.$kytos_version = version
Expand Down