-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
feat: demo Composition API #2099
Conversation
website/components/demo-block.vue
Outdated
class="control-button" | ||
@click.stop="onSwitchSyntax" | ||
> | ||
{{ showSetup? langConfig['switch-button-option-text'] : langConfig['switch-button-setup-text'] }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a space after showSetup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1
website/components/demo-block.vue
Outdated
if (result.indexOf('<template>') === 0) { | ||
return result.replace(/^<template>/, '').replace(/<\/template>$/,'') | ||
} | ||
return result | ||
} | ||
const sanitizeHTML = str => { | ||
var temp = document.createElement('div') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe using createDocumentFragment
API will be better? This is not a mandatory change though.
hlcode.innerHTML = sanitizeHTML(`<template>${this.codepen.html}</template> | ||
|
||
<script> | ||
${this.displayDemoCode} | ||
${'</sc' + 'ript>'} | ||
`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we format this code?
cc @XingXiaoWu, Hi, I'd like you to see the example of how to add |
It looks like add a button to change |
@XingXiaoWu You can check the first demo here https://preview-2099-element-plus.surge.sh/#/zh-CN/component/radio We have added a new feature to switch demo code between Composition API / Options API And all we have to do is to add a ` block in the demo code like this
|
Wow! It's really a good idea! I wiil change the code for |
@XingXiaoWu Thanks! Shout out for @0song for making such a good contribution! |
* fix: hot reload (#2077) (#2097) Co-authored-by: yangyu8 <yangyu8@kingsoft.com> * fix: fix popper in dialog isn't enough space to position problem (#2102) Co-authored-by: yangyu8 <yangyu8@kingsoft.com> * feat: demo Composition API (#2099) * feat: demo Composition API * chore: update * chore: update * chore: update * chore: update radio VCA doc (#2111) * fix: ImageViewer isLast attribute calculation error issue (#1902) (#2125) Co-authored-by: yangyu8 <yangyu8@kingsoft.com> * fix(col): col should hidden when span is zero (#1769) * fix: tabindex prop type (#2130) Co-authored-by: Qian Jie <jie.qian@blockheaders.com> * fix: week translations for hr locale (#2134) Co-authored-by: wp178491 <wp178491@alibaba-inc.com> * feat: use built-in throwError function. (#2131) * feat: use built-in throwError function. * Update index.vue * Update index.vue * feat(build): esbuild for single component build (#2112) * feat(input): add input-style prop (#2117) * feat(input): add input-style prop * test(input): add test case * fix: Cascader size issue when filterable and multiple are enabled (#2123) Co-authored-by: yangyu8 <yangyu8@kingsoft.com> * build(project): release/1-0-2-beta-46 (#2136) - Update release change log and update release script Co-authored-by: msidolphin <msidolphin@outlook.com> Co-authored-by: yangyu8 <yangyu8@kingsoft.com> Co-authored-by: 0song <82012629+0song@users.noreply.github.com> Co-authored-by: 神楽坂みずき <45122329+cokemine@users.noreply.github.com> Co-authored-by: bastarder <85257684@qq.com> Co-authored-by: Qian Jie <jie.qian@blockheaders.com> Co-authored-by: 好多大米 <lost1q84@gmail.com> Co-authored-by: wp178491 <wp178491@alibaba-inc.com> Co-authored-by: 波比小金刚 <2890636389@qq.com> Co-authored-by: hangzou <zouhang@didiglobal.com> Co-authored-by: Ryan2128 <33176053+Ryan2128@users.noreply.github.com>
Please make sure these boxes are checked before submitting your PR, thank you!
dev
branch.