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

How to pass parameter to dom-module #5658

Open
hexiaoting opened this issue May 12, 2020 · 2 comments
Open

How to pass parameter to dom-module #5658

hexiaoting opened this issue May 12, 2020 · 2 comments

Comments

@hexiaoting
Copy link

index.html:

<!DOCTYPE html>
<html>
<head>
    <script src="./deps/webcomponentsjs/webcomponents-lite.js"></script>
    <link rel="import" href="./check_base.html">
</head>
<body>
    <dashboard _srcMode=6 mood="happy"></dashboard>
</body>
</html>

check_base.html:

<link rel="import" href="./deps/polymer/polymer.html">
<dom-module id="dashboard">
<template>
	<p class="sidebar"> this is a test</p>
	<div > dfsafsa {{_srcMode}} [[mode]]</div>
<style>
.sidebar {
  display: flex;
  height: 100%;
	color:red;
}
</style>
</template>
</dom-module>

<script>
Polymer({
  is: 'dashboard',
  properties: {
    _srcMode:{
      type: Number,
      value: 10,
      observer: '_selectedModeChanged'
    },
    mood: String,
  },
	load: function() {
		console.log("loading");
	},
	created: function() {
		console.log("created");
		console.log("value=" + this.mood);
		this.mood="mmmm";
	},
        _selectedModeChanged: function() {
		console.log("_selectedModeChanged");
       }
});

</script>

But when I access index.html, value is not passed:
image

@stale
Copy link

stale bot commented Jun 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jun 2, 2021
@uniiquecornnx
Copy link

can we not contribute to this anymore?

@stale stale bot removed the wontfix label Jul 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants