Laravel / Vuejs链接的共享

时间:2018-11-23 10:19:21

标签: jquery laravel vuejs2 laravel-5.5

我想分享我的当前页面(如果是laravel)或分享帖子(如果是VUE js)。我已经在头上添加了og标签。图片和标题正在共享,但说明未共享。 我需要添加任何内容来分享说明。

以下是我的Head标签代码

<meta prefix="og: http://ogp.me/ns#" property="og:title" content="B1G1: Business for Good" />
    <meta prefix="og: http://ogp.me/ns#" property="og:description" content="0 school meals to children in need in India were given." />
    <meta prefix="og: http://ogp.me/ns#" property="og:type" content="Test" />
    <meta prefix="og: http://ogp.me/ns#" property="og:image" content="https://api.b1g1.com/uploads/projects/10/1436419809_proj_sq_10.jpg" />
    <meta prefix="og: http://ogp.me/ns#" property="og:url" content="http://127.0.0.1:8000/testing" />

共享链接就像

<button onclick="window.open('https://www.linkedin.com/shareArticle?url={{url}}','_blank', 'width=600, height=600'); return false;">Share</button>

我错过了什么吗?

我添加了“共享”页面的当前格式。enter image description here

预先感谢

1 个答案:

答案 0 :(得分:0)

将按钮代码更改为以下内容(根据需要更改变量),您也可以发送评论

import java.util.InputMismatchException;
import java.util.Stack;

public class TSPNearestNeighbour
{
    private int numberOfNodes;
    private Stack<Integer> stack;

    public TSPNearestNeighbour()
    {
        stack = new Stack<Integer>();
    }
    public int[] tsp(int[][] adjacencyMatrix)
    {
        int[] arr= new int[100];
        numberOfNodes = adjacencyMatrix[1].length - 1;
        int[] visited = new
                int[numberOfNodes + 1];
        visited[1] = 1;
        stack.push(1);
        int element, dst = 0, i;
        int min = Integer.MAX_VALUE;
        boolean minFlag = false;
        System.out.print(1 + "\t");

        while (!stack.isEmpty())
        {
            element = stack.peek();
            i = 1;
            min = Integer.MAX_VALUE;
            while (i <= numberOfNodes)
            {
                if
                        (adjacencyMatrix[element][i] > 1 && visited[i] == 0)
                {



                    if (min > adjacencyMatrix[element][i])
                    {
                        min = adjacencyMatrix[element][i];
                        dst = i;
                        minFlag = true;
                    }
                }
                i++;
            }
            if (minFlag)
            {
                visited[dst] = 1;
                stack.push(dst);

                System.out.print(dst +"\t");


                minFlag = false;
                continue;
            }


           stack.pop();
        }

        return arr;// ignore this line,it's regarding my logic
    }

    public static int[] main (String[] args) {
        if (args.length < 2) {
            System.out.println("Two arguments required <city> <numbers>");
            System.exit(-1);
        }
        int number_of_nodes;
        number_of_nodes = Integer.parseInt(args[0]);

        String[] splitText = args[1].split(" +");
        int[] mat = new int[splitText.length];
        for (int i = 0; i < splitText.length; i++) {
            mat[i] = Integer.parseInt(splitText[i]); // since we are passing the parameters to matrix,we convert every value from string type to integer

        }

        int[] abc = new int[100];
        try {
            int adjacency_matrix[][] = new int[number_of_nodes + 1][number_of_nodes + 1];
            int count = 0;
            for (int i = 1; i <= number_of_nodes; i++) {
                for (int j = 1; j <= number_of_nodes; j++) {
                    if (count == mat.length)
                        break;
                    adjacency_matrix[i][j] = mat[(i - 1) * number_of_nodes + (j - 1)];//matrix input
                    count++;
                }
            }
            for (int i = 1; i <= number_of_nodes; i++) {
                for (int j = 1; j <= number_of_nodes; j++) {
                    if (adjacency_matrix[i][j] == 1 && adjacency_matrix[j][i] == 0) {

                        adjacency_matrix[j][i] = 1;
                    }
                }
            }
            System.out.println("the citys are visited as follows");
            TSPNearestNeighbour tspNearestNeighbour = new TSPNearestNeighbour();
            abc = tspNearestNeighbour.tsp(adjacency_matrix);
        } catch (InputMismatchException inputMismatch) {
            System.out.println("Wrong Input format");
        }

        return abc;
    }


}

有关您可以发送的信息的更多详细信息

https://developer.linkedin.com/docs/share-on-linkedin并转到“自定义URL”

希望有帮助