Browse Source

adding

master
Björn 4 years ago
parent
commit
8a8578a1a0
2 changed files with 16 additions and 5 deletions
  1. +1
    -1
      package.json
  2. +15
    -4
      src/TinyConsentLink.riot

+ 1
- 1
package.json View File

@ -1,6 +1,6 @@
{ {
"name": "tiny-consent", "name": "tiny-consent",
"version": "1.1.2",
"version": "1.1.3",
"description": "Consent Banner for GDPR with RiotJS, part of Tiny-Components", "description": "Consent Banner for GDPR with RiotJS, part of Tiny-Components",
"scripts": { "scripts": {
"dev": "npm run development", "dev": "npm run development",


+ 15
- 4
src/TinyConsentLink.riot View File

@ -1,10 +1,12 @@
<tiny-consent-link> <tiny-consent-link>
<a id="tiny-consent-link" class="tiny-consent-link" onclick={ handleOpen }> <a id="tiny-consent-link" class="tiny-consent-link" onclick={ handleOpen }>
{ state.options.text.open }
{ state.options.text }
</a> </a>
<script> <script>
import assign from 'assign-deep';
/** /**
* tiny-consent-link.riot * tiny-consent-link.riot
* *
@ -23,9 +25,18 @@
state: state:
{ {
options: { options: {
text: {
'open': 'Open'
}
text: 'open'
}
},
/**
*
*
*/
onBeforeMount()
{
if (this.props.options) {
this.state.options = assign(this.state.options, this.props.options);
} }
}, },


Loading…
Cancel
Save