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

display dynamic name on list? #27

Closed
youyi1314 opened this issue Oct 18, 2017 · 4 comments
Closed

display dynamic name on list? #27

youyi1314 opened this issue Oct 18, 2017 · 4 comments

Comments

@youyi1314
Copy link

At title,
i got this data

members:[
{ name:first_name,display:this.user.first_name},
{name:last_name,display:this.user.last_name},
{name:today_function_time,display:'Show Dynamic time from computed?'}
]

here is my template

<template slot="item" scope="s">
	<span v-text="s.item.display"></span>
</template>

when i use "@" it will show the text below:

Jason
Lee
*Dynamic Time

wish you can understand what i mean.
Thanks

@fritx
Copy link
Owner

fritx commented Oct 18, 2017

@youyi1314 You want the name to support function-typed?
https://github.com/fritx/vue-at/blob/dev/src/At.vue#L104-L107

itemName (v) {
  const { nameKey } = this
+  if (typeof nameKey === 'function') {
+    nameKey = nameKey()
+  }
  return nameKey ? v[nameKey] : v
},

No problem but I still don't understand well your use case, lol..

@youyi1314
Copy link
Author

@fritx Thanks for your reply
actually what I want is the name and the s.item.display dynamic some data I retried from API. like that day function for today have 3 timetables,
1.3pm
2.6pm
3.8pm

  • sometimes have random timetable like cinema 1 days have multiple time for a movie. sometimes 3 or 5
    or extra room.
    i use this is for easy user write the message for each time in textarea like:
    I have 2 people join the function @3pm and 2 people from @6pm will postpone to @8pm
    something like that, so easy user to check back the time from the list using '@'.
    thanks for your helping and this vue-at ^^

@youyi1314
Copy link
Author

I found what i actually need #16

@fritx
Copy link
Owner

fritx commented Oct 20, 2017

@youyi1314 awesome! that would be published soon

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