Sponsored Content
Top Forums Web Development Turning jQuery Code into Vue.js Post 303025645 by Scott on Thursday 8th of November 2018 08:35:59 AM
Old 11-08-2018
I see from the source in the test page link you sent that vbuserId and vbtheURL are both already in scope as Javascript variables, which means you can add them to your data function:

Code:
  data() {
    return {
      vbuserId: vbuserId,
      vbtheURL: vbtheURL,
      unixtime: '',
      name: "The UNIX and Linux Forums",
      url: "https://www.unix.com/",
      theavatar: ''
    };
  },

And then you can use them in your GetAvatar function:
Code:
    GetAvatar() {
      if (this.vbuserId > 0)
        this.theavatar = '<img src="' + this.vbtheURL + '" width="60px"></img>';
      else
        this.theavatar =
          '<span class="alt1" ...></span>';
    },

I guess you need for modify this...
Code:
  created() {
    GetAvatar();

to:
Code:
  created() {
    this.GetAvatar();

This User Gave Thanks to Scott For This Post:
 

6 More Discussions You Might Find Interesting

1. What is on Your Mind?

JQuery and CSS Flex Code for Responsive WOL Page

I have just wrote this jQuery to the WOL page, so the table of users on line will not need scrollbars and will instead transform into a responsive table: <script> jQuery(document).ready(function (){ jQuery("#neo-who-flex-tcat"). css({"display":"flex","flex-flow":"row wrap", ... (0 Replies)
Discussion started by: Neo
0 Replies

2. What is on Your Mind?

JQuery and CSS Flex Code for Responsive Forum Home Page

So far, I have completed making the home page more responsive (except for the forum stats at the top and the WOL box at the bottom, they still use scroll bars). xevV3_iZ8-s For full screen use the link below and set your YT resolution to 1080p60 HD https://youtu.be/xevV3_iZ8-s Here is... (1 Reply)
Discussion started by: Neo
1 Replies

3. What is on Your Mind?

JQuery to Add Code Tags to Selected Text

Hey. Someone find or write some jQuery code where we can select text with our mouse and then click or double click the highlighted / selected text and then it will wrap code tags around the highlighted text (in our editors). :) (0 Replies)
Discussion started by: Neo
0 Replies

4. Web Development

Simple Vue.js Component to Redirect to External Web Page Using Vue Router

Vue Router has some quirks and on of the quirks is that it is not reliable when adding external links using the vue-router library. After struggling with many solutions, I have found that creating a simple Vue.js component like this one seems to work the best (so far): Component Example: ... (0 Replies)
Discussion started by: Neo
0 Replies

5. Web Development

Vue JS 2 Tutorial by The Net Ninja: A Recommended Vue.js Video Tutorial Series

A number of people have asked me how to get started with Vue.js and my reply before today was to Google "Vue.js". That has changed and my recommendation to anyone who wants to learn the fastest growing, easiest to learn and use Vue.js web dev framework is to watch this video tutorial series: ... (0 Replies)
Discussion started by: Neo
0 Replies

6. Web Development

Vue.js component: Beautiful code highlighter

Sooner than later I will render forum discussions in Vue.js to complement the standard way of showing forum threads. Today, I ran across this component, vue-code-highlight Beautiful code syntax highlighting as Vue.js component. https://www.unix.com/members/1-albums225-picture1199.jpg ... (1 Reply)
Discussion started by: Neo
1 Replies
FEC(3)							   BSD Library Functions Manual 						    FEC(3)

NAME
fec_new, fec_encode, fec_encode, fec_free -- An erasure code in GF(2^m) SYNOPSIS
#include <fec.h> void * fec_new(int k, int n); void fec_encode(void *code, void *data[], void *dst, int i, int sz); int fec_decode(void *code, void *data[], int i[], int sz); void * fec_free(void *code); DESCRIPTION
This library implements a simple (n,k) erasure code based on Vandermonde matrices. The encoder takes k packets of size sz each, and is able to produce up to n different encoded packets, numbered from 0 to n-1, such that any subset of k of them permits reconstruction of the origi- nal data. The data structures necessary for the encoding/decoding must first be created using calling fec_new() with the desired parameters. The code descriptor returned by the function must be passed to other functions, and destroyed calling fec_free() Allowed values for k and n depend on a compile-time value of GF_BITS and must be k <= n <= 2^GF_BITS. Best performance is achieved with GF_BITS=8, although the code supports also GF_BITS=16. Encoding is done by calling fec_encode() and passing it pointers to the code descriptor, the source and destination data packets, the index of the packet to be produced, and the size of the packet. fec_decode() with pointers to the code, received packets, indexes of received packets, and packet size. Decoding is done in place, possibly shuffling the arrays passed as parameters. Decoding is deterministic as long as the received packets are different. The decoding procedure does some limited testing on this and returns if parameters are invalid. EXAMPLE
#include <fec.h> /* * example of sender code */ void *code ; int n, k ; void *src[] ; void *pkt ; code = new_code (k, n ); for (i = 0 ; i < k ; i++ ) src[i] = .. pointer to i-th source packet .. for (each packet to transmit) { i = ... index of the packet ; fec_encode(code, src, pkt, i, size) ; .. use packet in pkt } fec_free(code) ; /* * example of receiver code */ void *code ; int n, k ; void *data[] ; int *ix[] ; code = new_code (k, n ); for (i = 0 ; i < k ; i++ ) { ... receive a new packet ... data[i] = .. pointer to i-th source packet .. ix[i] = .. index of i-th source packet .. } fec_decode(code, data, ix, size) ; /* * now data[] has pointers to the source packets */ Please direct bug reports to luigi@iet.unipi.it . BSD
July 15, 1998 BSD
All times are GMT -4. The time now is 11:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy