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

Provide access to widget configuration from widget expressions #1698

Merged
merged 1 commit into from
Feb 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ export default {
},
config () {
if (!this.context || !this.context.component) return null
const sourceConfig = this.context.component.config
let evalConfig = {}
if (this.context.component.config) {
if (typeof this.context.component.config !== 'object') return {}
for (const key in this.context.component.config) {
const sourceConfig = this.context.component.config
if (typeof sourceConfig !== 'object') return {}
for (const key in sourceConfig) {
if (key === 'visible' || key === 'visibleTo' || key === 'stylesheet') continue
this.$set(evalConfig, key, this.evaluateExpression(key, sourceConfig[key]))
}
Expand Down Expand Up @@ -131,6 +131,7 @@ export default {
return expr.evaluate(this.exprAst[key], {
items: ctx.store,
props: this.props,
config: ctx.component.config,
vars: ctx.vars,
loop: ctx.loop,
Math: Math,
Expand Down