-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Take a stab at porting existing components to Vue3 #20044
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 from all commits
62afdcf
0e8c81e
295c724
d3381fc
e4a9441
e8c5061
7b013b8
6deb736
d16b5db
466b248
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -1,4 +1,4 @@ | ||||||||||
import Vue from 'vue'; | ||||||||||
import {createApp} from 'vue'; | ||||||||||
import {svgs} from '../svg.js'; | ||||||||||
|
||||||||||
export const vueDelimiters = ['${', '}']; | ||||||||||
|
@@ -8,13 +8,14 @@ export function initVueEnv() { | |||||||||
if (vueEnvInited) return; | ||||||||||
vueEnvInited = true; | ||||||||||
|
||||||||||
const isProd = window.config.runModeIsProd; | ||||||||||
Vue.config.productionTip = false; | ||||||||||
Vue.config.devtools = !isProd; | ||||||||||
// As far as I could tell, this is no longer possible. | ||||||||||
// But there seem not to be a guide what to do instead. | ||||||||||
// const isProd = window.config.runModeIsProd; | ||||||||||
// Vue.config.devtools = !isProd; | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this option was moved to compile-time config, https://github.com/vuejs/core/tree/main/packages/vue#bundler-build-feature-flags, but it might just be that it's no longer necessary to get rid of devtools in prod build as the docs sound like it's disabled by default. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, compile-time config won't be evaluated at runtime, though. That is, I can't go via The value is injected in gitea/templates/base/head_script.tmpl Line 14 in 0e8c81e
which in turn is defined in gitea/modules/context/context.go Line 703 in 0e8c81e
which in turn is derived from gitea/modules/setting/setting.go Lines 1015 to 1016 in 0e8c81e
… so … is there a way I can somehow read this from Node.js? |
||||||||||
} | ||||||||||
|
||||||||||
let vueSvgInited = false; | ||||||||||
export function initVueSvg() { | ||||||||||
export function initVueSvg(app) { | ||||||||||
6543 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
if (vueSvgInited) return; | ||||||||||
vueSvgInited = true; | ||||||||||
|
||||||||||
|
@@ -24,7 +25,7 @@ export function initVueSvg() { | |||||||||
.replace(/height="[0-9]+"/, 'v-bind:height="size"') | ||||||||||
.replace(/width="[0-9]+"/, 'v-bind:width="size"'); | ||||||||||
|
||||||||||
Vue.component(name, { | ||||||||||
app.component(name, { | ||||||||||
props: { | ||||||||||
size: { | ||||||||||
type: String, | ||||||||||
|
@@ -42,8 +43,7 @@ export function initVueApp(el, opts = {}) { | |||||||||
} | ||||||||||
if (!el) return null; | ||||||||||
|
||||||||||
return new Vue(Object.assign({ | ||||||||||
el, | ||||||||||
delimiters: vueDelimiters, | ||||||||||
}, opts)); | ||||||||||
return createApp( | ||||||||||
Object.assign({delimiters: vueDelimiters}, opts) | ||||||||||
).mount(el); | ||||||||||
} |
Uh oh!
There was an error while loading. Please reload this page.